﻿using SD.Common.PoweredByLee;
using SD.ContentSystem.Domain.Entities;
using SD.ContentSystem.IAppService.DTOs.Outputs;

namespace SD.ContentSystem.AppService.Maps
{
    /// <summary>
    /// 链接映射工具类
    /// </summary>
    public static class LinkMap
    {
        #region # 链接类别映射 —— static LinkCategoryInfo ToDTO(this LinkCategory...
        /// <summary>
        /// 链接类别映射
        /// </summary>
        /// <param name="category">链接类别领域模型</param>
        /// <returns>链接类别数据传输对象</returns>
        public static LinkCategoryInfo ToDTO(this LinkCategory category)
        {
            LinkCategoryInfo categoryInfo = Transform<LinkCategory, LinkCategoryInfo>.Map(category);

            return categoryInfo;
        }
        #endregion

        #region # 链接映射 —— static LinkInfo ToDTO(this Link link)
        /// <summary>
        /// 链接映射
        /// </summary>
        /// <param name="link">链接领域模型</param>
        /// <returns>链接数据传输对象</returns>
        public static LinkInfo ToDTO(this Link link)
        {
            LinkInfo linkInfo = Transform<Link, LinkInfo>.Map(link);

            return linkInfo;
        }
        #endregion
    }
}